package com.wxzz.elearing.comment.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.time.LocalDateTime;
import java.util.List;

@Data
@Document(collection = "curriculumCommentCollection")
@ApiModel(value = "CurriculumComment对象", description = "课程评论")
public class CurriculumComment {

    @Id
    private String uid;

    @Field("curriculumId")
    @ApiModelProperty(value = "改善id")
    private Long curriculumId;

    @ApiModelProperty(value = "评论用户id")
    @Field("wxUserId")
    private Long wxUserId;

    @ApiModelProperty(value = "评论用户名")
    @Field("nickname")
    private String nickname;

    @ApiModelProperty(value = "评论用户头像")
    @Field("icon")
    private String icon;

    @ApiModelProperty(value = "评论内容")
    @Field("commentContent")
    private String commentContent;

    @ApiModelProperty(value = "评论打星")
    @TableField(exist = false)
    private Integer star;

    @ApiModelProperty(value = "图片地址 多个用,分隔")
    private String publishImageUrl;

    @ApiModelProperty(value = "图片地址 数组")
    @TableField(exist = false)
    private List<String> publishImageUrlList;

    @ApiModelProperty(value = "评论时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Field("createTime")
    private LocalDateTime createTime;
}
